/**
*      author: Y_Yao
*      created: 2025-02-22 20:05:22
**/

#include<bits/stdc++.h>

#define int LL
using namespace std;
using LL = long long;
const LL LLINF = 1e18;
const int INF = 0x3f3f3f3f;
string s;
vector<char> st;

void solve()
{
    cin >> s;
    for(int i = 0;i < s.size();i++)
    {
        st.push_back(s[i]);
        int flag = 1;
        int cnt = 0;
        while(s[i] == 'A' && st.size() >= 2 && st[st.size() - 2] == 'W')
        {
            st.pop_back();
            flag = 0;
            cnt++;
        }
        if(flag == 0)
        {
            st.pop_back();
            st.push_back('A');
            while(cnt--)
            {
                st.push_back('C');
            }
        }
    }


    for(auto& e : st)
    {
        cout << e;
    }
}

signed main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);

    int t = 1;
    //cin >> t;
    while(t--)
    {
        solve();
    }
    return 0;
}